{% macro gen_table(demands) %}
    <table id="demand-info-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th style="width: 9%;">手机号</th>
                <th>用户昵称</th>
                <th>需求分类</th>
                <th>来源</th>
                <th>状态</th>
                <th>sem来源</th>
                <th>sem计划</th>
                <th>sem单元</th>
                <th>sem_keyword</th>
                <th>ip</th>
                <th>cookies</th>
                <th>创建时间</th>
                <th>发布时间</th>
            </tr>
        </thead>
        <tbody>
            {% for demand in demands %}
            <tr>
                {% if demand.owner %}
                    <td>{{ demand.owner.mobile | encrypt }}</td>
                    <td>{{ demand.owner.nickname }}</td>
                {% else %}
                    <td></td>
                    <td></td>
                {% endif %}
                <td>{{ demand.cate_display }}</td>
                <td>{{ demand.source }}</td>
                <td>{{ demand.status_display }}</td>
                <td>{{ demand.sem_source or '' }}</td>
                <td>{{ demand.sem_plan or '' }}</td>
                <td>{{ demand.sem_unit or '' }}</td>
                <td>{{ demand.sem_keyword or '' }}</td>
                <td>{{ demand.ip }}</td>
                <td>{{ demand.device_cookies }}</td>
                <td>{{ demand.created_datetime }}</td>
                <td>{{ demand.published_datetime }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% endmacro %}
